﻿CREATE PROCEDURE [acms].[EmailActivationCode_GetByCodeAndSiteId]
	@Code varchar(10), 
	@SiteId int
AS
	SELECT a.*
	From [EmailActivationCode_View] a
		inner join [User_View] b on a.UserId = b.Id
	Where a.Code = @Code and isNull(b.SiteId, @SiteId) = @SiteId
RETURN 0